//
//  LYFriendViewController.m
//  artist
//
//  Created by Jay_Apple on 16/3/2.
//  Copyright © 2016年 viviyoo. All rights reserved.
//

#import "LYFriendViewController.h"
#import "LYArtViewController.h"
#import "LYCircleListModel.h"

@interface LYFriendViewController ()<UIScrollViewDelegate>

@end

@implementation LYFriendViewController

- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    
}

- (void)viewWillAppear:(BOOL)animated{

    [super viewWillAppear:animated];
    
    if (self.childVCs.count == 0) {
        [self getCircles];
    }

}

/**
 *  获取圈子
 */
- (void)getCircles{

    
    [LYRequestTool acquirCircleListWithToken:LYToken type:@"all" success:^(NSArray<LYCircleListModel *> *circles) {
        
        NSMutableArray *circleVCs = [NSMutableArray array];
        
        for (LYCircleListModel *model in circles) {
            
             LYArtViewController *art = [[LYArtViewController alloc] init];
            art.model = model;
            [circleVCs addObject:art];
            
        }
        
        self.childVCs = circleVCs;
        
        
    } failure:^(NSString *code, NSString *message) {
        
        
        
    }];

}

@end